package com.cmict.data.infra.api.message;

import com.cmict.data.infra.api.message.dto.MessageDTO;
import com.cmict.data.infra.api.emus.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 *
 *
 * @author awesome
 */
@FeignClient(name = ApiConstants.NAME)
@Api(tags = "RPC 服务 - 部门")
public interface MessageSendApi {

    String PREFIX = com.cmict.data.infra.enums.ApiConstants.PREFIX + "/message-template";

    @GetMapping(PREFIX + "/sendByTemplate")
    @ApiOperation("发送模板消息")
    Boolean sendMessageByTemplate(@Valid @RequestBody MessageDTO messageDTO);

    @GetMapping(PREFIX + "/template")
    @ApiOperation("根据题目获取title")
    @ApiImplicitParam(name = "title", value = "模板名称", example = "模板", required = true, dataTypeClass = String.class)
    Long getTemplateByTitle(@RequestParam("title")String title);

}
